package com.niuke;

import java.util.Scanner;

/**
 * 8. 计算误码率
 * https://blog.csdn.net/qfc_128220/article/details/130774905
 */
public class NiukeMoni10 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        StringBuilder sb1 = new StringBuilder();
        String input1 = scanner.nextLine();

        // 这里传承 char 类型数组有些问题，如果出现两位数或者更高位的数字，得到的字符串将错误
        char[] a = input1.toCharArray();
        for (int i = 0; i < a.length; i++) {
            for (int j = 0; j < (a[i] - '0'); j++) {
                sb1.append(a[i + 1]);
            }
            i++;
        }
        String str1 = sb1.toString();
        System.out.println(str1);

        StringBuilder sb2 = new StringBuilder();
        String input2 = scanner.nextLine();
        char[] b = input2.toCharArray();
        for (int i = 0; i < b.length; i++) {
            for (int j = 0; j < (b[i] - '0'); j++) {
                sb2.append(b[i + 1]);
            }
            i++;
        }
        String str2 = sb2.toString();
        System.out.println(str2);

        int errCount = 0;
        for (int i = 0; i < str1.length(); i++) {
            if (str1.charAt(i) != str2.charAt(i)) {
                errCount++;
            }
        }

        System.out.println(errCount + "/" + sb1.length());

    }

}
